package com.demo1221.demo02.entity;

import javax.servlet.http.HttpSession;
import java.util.Objects;

public class User {
    private String name;
    private String ip;
    private String LoginTime;
    private HttpSession session;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(name, user.name) && Objects.equals(ip, user.ip) && Objects.equals(LoginTime, user.LoginTime) && Objects.equals(session, user.session);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name);
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", ip='" + ip + '\'' +
                ", LoginTime='" + LoginTime + '\'' +
                ", session=" + session +
                '}';
    }

    public User(String name, String ip, String loginTime, HttpSession session) {
        this.name = name;
        this.ip = ip;
        LoginTime = loginTime;
        this.session = session;
    }

    public HttpSession getSession() {
        return session;
    }

    public void setSession(HttpSession session) {
        this.session = session;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getLoginTime() {
        return LoginTime;
    }

    public void setLoginTime(String loginTime) {
        LoginTime = loginTime;
    }



    public User() {
    }
}
